package entity.zhujie.demo02;

public class MainTest {
    public static void main(String[] args) {
        chek(ChinaPeople.class);

    }

    private static void chek(Class<?> clazz) {

        boolean present = clazz.isAnnotationPresent(HelloWorldAnnotation.class);
        if (!present){
            System.out.println("不存在注解");
            return;
        }
        /*
         * 获取HelloWorldAnnotation 注解*/
        HelloWorldAnnotation aClassAnnotation = clazz.getAnnotation(HelloWorldAnnotation.class);
        /*
         * 获取注解的值*/
        String value = aClassAnnotation.value();

        /*
         * 基于注解的值进行相关的处理，从而实现相关功能的业务
         * */
        System.out.println("国家的问候语:" + value);
    }
}
